<!DOCTYPE html>
<html lang="en">
      <head>
        <meta charset="UTF-8">
        <title>各商店的商品</title>
        <link rel="stylesheet" type="text/css" href="../page/fabu/index.css">
        <link rel="stylesheet" type="text/css" href="../page/common/layout.css">
        <script type="text/javascript" src="../util/jquery.min.js"></script>
        <script type="text/javascript" src="../util/dot.js"></script>
        <script type="text/javascript" src="../util/font/iconfont.js"></script>
        <script type="text/javascript" src="../util/jquery.min.js"></script>
        <style type="text/css">
	        input{
	        	height: 40px;
	        	width: 200px;
	        }
        	select{
        		width: 200px;
        	}
        	img{
        		width: 200px;
        	}
        	td{
        		border-bottom-style: 1px;
        	}
        </style>
        <script type="text/javascript">
        	$(function(){
        //获取商品
              $.ajax({ 
			     type: "post",
			     //大分类查询地址
			     url: "http://localhost:8080/SST/view/goodsAllByShop.do?", 
			     data: "category="+1, 
			     success: function(msg){ 
			    	 //成功 执行回调函数
			    	 var list = eval(msg);// msg是返回数据
			    	 $.each(list,function(index,g){
			    		$("#goods").append("<tr><td>"+g.goods_name+"</td><td>"+g.goods_detail+"</td><td><img  src='/goods/images/"+g.goods_dimage+"'></td><td>"+g.goods_price+"</td ><td onload='getCategory("+g.is_good+")'></td><td><a href='goodsupdateone.do?goods_id="+g.goods_id+"'>修改</a> <a href='goodsdelete.do?goods_id="+g.goods_id+"'>删除</a></td></tr>");
			    	 	});
			    	 } 	
                   
                   });
        	});
        	function getCategory(bigclass_id){
 
	        		/* $.ajax({ 
	    			     type: "post",
	    			     url: "http://localhost:8080/SST/view/getSClassById.do?", 
	    			     data: "id="+bigclass_id, 
	    			     success: function(msg1){ 
	    			    	 //成功 执行回调函数  
	    			    	 c = eval(msg).case1;// msg是返回数据    	 
	    			    	 } 	
	    			});
				    $(this).text(c);	 */	
				    $(this).text(111);
        		} 
        	
        </script>
    </head>
    <body> 
        
    我的商品：	
      	<table id="goods">
      		<tr>	
      			<td >商品名</td>
      			<td>商品描述</td>
      			<td>商品图片</td>
      			<td>商品价格</td>
      			<td>商品分类</td>
      			<td>操作</td>
      		</tr>
      	</table>
        
    </body>
</html>